package com.qd.common.panda.domain.entity.invoice;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;

/**
 * 个人开票信息
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
public class UserInvoiceDTO extends BaseQuery {

    @ExcelIgnore
    @JsonIgnore
    private static final String EXCEL_TITLE = "个人开票信息";
    /**
     * 主键
     */
    @ExcelProperty(value = {EXCEL_TITLE, "个人开票ID"})
    @NotBlank(message = "个人开票ID不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 50, message = "个人开票ID长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String userInvoiceId;
    /**
     * 发票抬头
     */
    @ExcelProperty(value = {EXCEL_TITLE,"发票抬头"})
    @Size(max = 100, message = "发票抬头长度不能超过{max}位", groups = DefaultGroup.class)
    private String title;
    /**
     * 税号
     */
    @Size(max = 50, message = "税号长度不能超过{max}位", groups = DefaultGroup.class)
    private String dutyParagraph;
    /**
     * 手机号码
     */
    @NotBlank(message = "手机号码不能为空", groups = DefaultGroup.class)
    @Size(max = 20, message = "手机号码长度不能超过{max}位", groups = DefaultGroup.class)
    private String mobile;
    /**
     * 邮箱地址
     */
    @Email(message = "邮箱地址格式不正确", groups = DefaultGroup.class)
    @Size(max = 50, message = "邮箱地址长度不能超过{max}位", groups = DefaultGroup.class)
    private String email;
    /**
     * 添加时间
     */
    private LocalDateTime addTime;
    /**
     * 修改时间
     */
    private LocalDateTime updateTime;
    /**
     * 用户ID
     */
    @Size(max = 50, message = "用户ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String userId;
    /**
     * 抬头类型
     */
    @NotBlank(message = "抬头类型不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "抬头类型长度不能超过{max}位", groups = DefaultGroup.class)
    private String typeHeader;
    /**
     * 抬头类型显示
     */
    private String typeHeaderDisplay;

    @Override
    public void freeData() {
        this.userInvoiceId = null;
        this.title = null;
        this.dutyParagraph = null;
        this.mobile = null;
        this.email = null;
        this.addTime = null;
        this.updateTime = null;
        this.userId = null;
        this.typeHeader = null;
        this.typeHeaderDisplay = null;
        super.freeData();
    }
}
